package com.struts.bean;
// Generated 21/11/2011 16:44:30 by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Usuario generated by hbm2java
 */
@Entity
@Table(name="usuario"
    ,catalog="crud"
)
public class Usuario implements java.io.Serializable {

     private Integer id;
     private String nome;
     private int cpf;
     private Set<Arquivos> arquivoses = new HashSet<Arquivos>(0);

    public Usuario() {
    }
	
    public Usuario(String nome, int cpf) {
        this.nome = nome;
        this.cpf = cpf;
    }
    public Usuario(String nome, int cpf, Set<Arquivos> arquivoses) {
       this.nome = nome;
       this.cpf = cpf;
       this.arquivoses = arquivoses;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id", unique=true, nullable=false)
    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
    
    @Column(name="nome", nullable=false, length=200)
    public String getNome() {
        return this.nome;
    }
    
    public void setNome(String nome) {
        this.nome = nome;
    }
    
    @Column(name="cpf", nullable=false)
    public int getCpf() {
        return this.cpf;
    }
    
    public void setCpf(int cpf) {
        this.cpf = cpf;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="usuario")
    public Set<Arquivos> getArquivoses() {
        return this.arquivoses;
    }

    public void setArquivoses(Set<Arquivos> arquivoses) {
        this.arquivoses = arquivoses;
    }
}


